/**
* @Author: 858834013@qq.com
* @Name: dateTimePicker
* @Date: 2022-01-18
* @Desc: 日期时间选择器
*/
<template>
	<div>
		<div @click="show=true">
			<slot></slot>
		</div>
		<u-datetime-picker :minDate="timestamp" @cancel="show=false" @confirm="getConfirm" :show="show" mode="date">
		</u-datetime-picker>
	</div>
</template>

<script>
	export default {
		name: 'dateTimePicker',
		components: {},
		props: {
			list: {
				type: Array,
				default () {
					return []
				}
			}
		},
		data() {
			return {
				show: false,
				timestamp: (new Date()).valueOf()
			};
		},
		methods: {
			getConfirm(e) {
				if (e.value) {
					this.$emit('getdata', e)
				} else {
					e.value = (new Date()).valueOf()
					this.$emit('getdata', e)
				}
				console.log(e)
				this.show = false
			}
		}
	}
</script>

<style lang="scss" scoped>

</style>
